package com.moo.imgprogress.imgprogressbar;

import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

public class MainActivity extends AppCompatActivity {
    private ImgProgressBar progressBar;

    private int offset = 5;

    private Handler handler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
        }
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        progressBar = (ImgProgressBar) findViewById(R.id.ipb_main_progress);

    }

    public void add(View view) {
        progressBar.setOffset(offset);
        offset += 5;
        progressBar.setAnimationProgress(80);
    }

    @Override
    protected void onResume() {
        super.onResume();
        progressBar.setAnimationProgress(100);
    }
}
